package com.loukou.lkt.lkt.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import com.loukou.lkt.lkt.entity.PoPurchaseReturnOrderDetail;

public interface PoPurchaseReturnOrderDetailDao extends CrudRepository<PoPurchaseReturnOrderDetail,Integer>{
	

	List<PoPurchaseReturnOrderDetail> findByOrderId(int orderId);
	
	@Modifying
	@Transactional
	@Query("update PoPurchaseReturnOrderDetail set deliveryNumber=?2 where id=?1")
	void updateDeliveryNumberForApi(int id,int deliveryNumber);

	@Modifying
	@Transactional
	@Query("update PoPurchaseReturnOrderDetail set orderNumber=?2, taxPrice=?1 where goodsSpecId=?3")
	void updateForEdit(double returnPrice, int returnNum, int goodsSpecId);
}
